package ch11.d4;

import java.util.Random;

public class Mouse extends Thread{
    int distance = 0;
    @Override
    public void run() {
        Random r=new Random();
        while(true) {
            distance+=r.nextInt(5);
            System.out.println("Mouse running..."+distance+"米");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
